package com.by.aop;

import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

/**
 * @author hsitung
 * @ClassName:
 * @Description: (这里用一句话描述这个类的作用)
 * @date *
 */
@Aspect
@Component
@SuppressWarnings("all")
public class LogAop {
	
	private Logger log = LoggerFactory.getLogger(LogAop.class);

	@Pointcut("@annotation(Operation)")
	private void pointCut(){

	}

	/*@Pointcut(value = "@annotation(operation) && args(parames)", argNames = "operation, parames")
	public void sa(Operation operation, String parames) {

	}*/

	@Around(value = "@annotation(operation) ")
	public Object before(ProceedingJoinPoint point, Operation operation) throws Throwable {
		log.debug(operation.value());

		Object object = null;

		object = point.proceed();

		return object;
	}


}
